#include "Triangulo.h"

using namespace std;

Triangulo::Triangulo(Materiais *mat, Texturas *tex, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) : Primitiva(mat, tex) {

	this->x1 = x1;
	this->y1 = y1;
	this->z1 = z1;
	this->x2 = x2;
	this->y2 = y2;
	this->z2 = z2;
	this->x3 = x3;
	this->y3 = y3;
	this->z3 = z3;

}

void Triangulo::aplica() {
	this->getMaterial()->aplica();
	this->getTextura()->aplica();

	glEnable(GL_POLYGON);
		glNormal3b(0.0,0.0,1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(this->x1,this->y1,this->z1);
		glTexCoord2f(0.0,0.0); glVertex3f(this->x2,this->y2,this->z2);
		glTexCoord2f(0.0,0.0); glVertex3f(this->x3,this->y3,this->z3);
	glDisable(GL_POLYGON);
}